package org.zcl;

import org.springframework.boot.SpringApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

//@EnableEurekaClient
//@EnableCircuitBreaker
//@EnableHystrix
//@SpringBootApplication
@SpringCloudApplication
@EnableFeignClients
public class HystrixConsumerApplication {

    @Bean
    @LoadBalanced
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }

/*    @Bean
    public Retryer feignRetryer() {
//        return new Retryer.Default();
        return new Retryer.Default(100, SECONDS.toMillis(1), 1);
    }*/

    public static void main(String[] args) {
        SpringApplication.run(HystrixConsumerApplication.class, args);
    }

}
